﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;

public partial class ProductManager_AddPrdtImages : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            if (Request.QueryString["prdtId"] != null && Request.QueryString["prdtName"] != null && Request.QueryString["prdtTypeId"] != null)
            {
                hidPrdt.Value = Request.QueryString["prdtId"].ToString();
                hidPrdtType.Value = Request.QueryString["prdtTypeId"].ToString();
                lblPrdtName.Text = Request.QueryString["prdtName"].ToString();
            }
        }
    }

    protected void btnUpload_Click(object sender, EventArgs e)
    {
        IList<FileUpload> fuList = new List<FileUpload>();
        fuList.Add(FileUpload1);
        fuList.Add(FileUpload2);
        fuList.Add(FileUpload3);
        fuList.Add(FileUpload4);
        fuList.Add(FileUpload5);
        fuList.Add(FileUpload6);
        fuList.Add(FileUpload7);
        fuList.Add(FileUpload8);
        fuList.Add(FileUpload9);
        fuList.Add(FileUpload10);
        GoShopping.BLL.ProductImgBean.SetProductImage(Convert.ToInt32(hidPrdt.Value), Convert.ToInt32(hidPrdtType.Value), fuList);
        //GoShopping.BLL.ProductImgBean.SetProductImage(Convert.ToInt32(hidPrdt.Value), Convert.ToInt32(hidPrdtType.Value), FileUpload2);
        //GoShopping.BLL.ProductImgBean.SetProductImage(Convert.ToInt32(hidPrdt.Value), Convert.ToInt32(hidPrdtType.Value), FileUpload3);
        //GoShopping.BLL.ProductImgBean.SetProductImage(Convert.ToInt32(hidPrdt.Value), Convert.ToInt32(hidPrdtType.Value), FileUpload4);
        //GoShopping.BLL.ProductImgBean.SetProductImage(Convert.ToInt32(hidPrdt.Value), Convert.ToInt32(hidPrdtType.Value), FileUpload5);
        //GoShopping.BLL.ProductImgBean.SetProductImage(Convert.ToInt32(hidPrdt.Value), Convert.ToInt32(hidPrdtType.Value), FileUpload6);
        //GoShopping.BLL.ProductImgBean.SetProductImage(Convert.ToInt32(hidPrdt.Value), Convert.ToInt32(hidPrdtType.Value), FileUpload7);
        //GoShopping.BLL.ProductImgBean.SetProductImage(Convert.ToInt32(hidPrdt.Value), Convert.ToInt32(hidPrdtType.Value), FileUpload8);
        //GoShopping.BLL.ProductImgBean.SetProductImage(Convert.ToInt32(hidPrdt.Value), Convert.ToInt32(hidPrdtType.Value), FileUpload9);
        //GoShopping.BLL.ProductImgBean.SetProductImage(Convert.ToInt32(hidPrdt.Value), Convert.ToInt32(hidPrdtType.Value), FileUpload10);
        Response.Redirect("PrdtImageList.aspx?prdtId=" + hidPrdt.Value + "prdtTypeId" + hidPrdtType.Value);
    }
}
